package com.huluobo.a2204monthdemo.detail

import androidx.lifecycle.MutableLiveData
import com.huluobo.base.bean.CommentBeanResult
import com.huluobo.base.bean.GoodsDetailBean
import com.huluobo.base.bean.GoodsDetailBeanResult
import com.huluobo.base.viewmodel.BaseViewModel

/**
 *  Created by LC on 2024/8/9.
 */
class DetailViewModel : BaseViewModel<DetailRepo>() {
    val getGoodsDetailSuccess = MutableLiveData<GoodsDetailBeanResult>()
    val getGoodsDetailFailed = MutableLiveData<String>()

    val getCommentSuccess = MutableLiveData<CommentBeanResult>()
    val getCommentFailed = MutableLiveData<String>()

    fun getComment() {
        repo.getComment(getCommentSuccess, getCommentFailed)
    }

    fun getGoodsDetail(goodsId: Int) {
        repo.getGoodsDetail(goodsId, getGoodsDetailSuccess, getGoodsDetailFailed)
    }

    val goodsBean = MutableLiveData<GoodsDetailBean>()

    override fun createRepo(): DetailRepo = DetailRepo()
}